home *** CD-ROM | disk | FTP | other *** search
- Path: news.logicon.com!newsmaster@klee
- From: kkolda@logicon.com (Kenneth D. Kolda)
- Newsgroups: comp.lang.c++
- Subject: Re: strstream destruction
- Date: 29 Mar 1996 20:24:00 GMT
- Organization: Logicon Operating Systems
- Message-ID: <4jhgt0$17f@piper.logicon.com>
- References: <315AD92C.726D@itd.ssb.com>
- NNTP-Posting-Host: 137.51.122.161
- Mime-Version: 1.0
-
- In article <315AD92C.726D@itd.ssb.com>, chandpk@itd.ssb.com says...
- >
- >hi,
- > i plan to use ostrstream to create some strings , i would
- >like to pass the string created as a char * by calling ostrstream.str().
- >how do i free the memory allocated can i just call delete on the char *
- >returned by ostrstream.str().
- >
- >thanks.
- >pramod.
- >--
- >
- >
- > The butler walked in , a solemn procession of one.
- > -P.G.Wodehouse
-
-
- As long as this is a "dynamic" ostrstream, i.e. you do not provide the
- character buffer in the constructor, then when you recieve the char* from
- the ostrstream::str() method, you should delete the result using the
- "delete[]" operator.
-
- Ken Kolda
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ostrstream MyStream;
-
-